//
//  ZYCollectionTableViewCell.m
//  ALearningWalk
//
//  Created by 张勇 on 16/7/2.
//  Copyright © 2016年 战斗民族. All rights reserved.
//

#import "ZYCollectionTableViewCell.h"

@interface ZYCollectionTableViewCell ()



@end

@implementation ZYCollectionTableViewCell


-(void)dealloc{
    [_imageV release];
    [_myLabel release];
    [super dealloc];

}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
    }
    return self;
}

-(void)createSubviews{

    self.imageV = [[UIImageView alloc] init];
    self.imageV.backgroundColor = [UIColor clearColor];
    
    [self.contentView addSubview:self.imageV];
    
    self.myLabel = [[UILabel alloc] init];
    self.myLabel.backgroundColor =[UIColor clearColor];
    [self.contentView addSubview:self.myLabel];
    
    [_imageV release];
    [_myLabel release];

}

-(void)layoutSubviews{

    self.imageV.frame = CGRectMake(10, 10, self.frame.size.height - 20, self.frame.size.height - 20);
    self.imageV.layer.masksToBounds = YES;
    self.imageV.layer.cornerRadius = self.imageV.frame.size.height / 2;
    self.myLabel.frame = CGRectMake(self.frame.size.height, self.frame.size.height / 3, self.frame.size.width - self.frame.size.height, self.frame.size.height / 3);

}

-(void)setModel:(smallListModel *)model{
    _model = model;
    [self.imageV sd_setImageWithURL:[NSURL URLWithString:_model.albumCoverUrl290] placeholderImage:[UIImage imageNamed:@""]];
    self.myLabel.text = _model.title;


}

@end
